package dao

import (
	"zg3yk/inits"
	"zg3yk/model"
)

func GetUser(mobile string) (result *model.User, err error) {
	if err = inits.DB.Where("mobile=?", mobile).Find(&result).Error; err != nil {
		return nil, err
	}
	return result, nil
}
func CreateUser(mobile string) (err error) {
	result := &model.User{
		Mobile: mobile,
	}
	if err = inits.DB.Create(&result).Error; err != nil {
		return err
	}
	return nil
}
